package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 工作流agree枚举
 * @author ds
 * @date 2021/6/18
 * @version 2.0.0
 */
public enum ProcessAgreeEnum {
    THROUGH(-1, "无条件下一步"),
    REJECT(0, "驳回"),
    CONDITION1(1, "条件跳转1"),
    CONDITION2(2, "条件跳转2"),
    CONDITION3(3, "条件跳转3")
    ;

    private final Integer code;
    private final String message;

    ProcessAgreeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        ProcessAgreeEnum processAgreeEnum = Arrays.stream(ProcessAgreeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return processAgreeEnum==null?"未知":processAgreeEnum.getMessage();
    }


}
